package guitest03;

import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PersonFrame extends JPanel
{

    JLabel name = new JLabel("Person's Name");
    JLabel lastLabel = new JLabel("Last Name:");
    JLabel firstLabel = new JLabel("First Name:");
    JLabel middleLabel = new JLabel("Middle Name:");
    JLabel dobLabel = new JLabel("Date of Birth:");
    JLabel phoneLabel = new JLabel("Phone Number:");
    JLabel ssnLabel = new JLabel("Social Sercurity Number");
    JLabel genderLabel = new JLabel("Gender:");
    JLabel addressLabel = new JLabel("Address");
    JPanel namePanel = new JPanel();
    JPanel addressPanel = new JPanel();
    JTextField lastText = new JTextField();
    JTextField firstText = new JTextField();
    JTextField middleText = new JTextField();
    JTextField dobText = new JTextField();
    JTextField phoneArea = new JTextField();
    JTextField phonePrefix = new JTextField();
    JTextField phoneSuffix = new JTextField();
    JTextField ssn1 = new JTextField();
    JTextField ssn2 = new JTextField();
    JTextField ssn3 = new JTextField();
    JTextField genderText = new JTextField();
    JButton addButton = new JButton("Add");
    JButton removeButton = new JButton("Remove");
    JButton submitButton = new JButton("Submit");
    

    public PersonFrame()
    {
        setLayout(null);
        //size of window
        setSize(1100, 650);
        setBackground(Color.lightGray);
        setVisible(true);

        //add components
        add(name);
        add(dobLabel);
        add(dobText);
        add(phoneLabel);
        add(phoneArea);
        add(phonePrefix);
        add(phoneSuffix);
        add(ssnLabel);
        add(genderLabel);
        add(addressLabel);
        add(namePanel);
        add(ssn1);
        add(ssn2);
        add(ssn3);
        add(genderText);
        add(addressPanel);
        add(addButton);
        add(removeButton);
        add(submitButton);

        //setting Bounds
        name.setBounds(25, 25, 100, 25);
        namePanel.setBounds(25, 50, 200, 125);
        dobLabel.setBounds(25, 225, 100, 25);
        dobText.setBounds(125, 225, 100, 25);
        phoneLabel.setBounds(325, 50, 100, 25);
        phoneArea.setBounds(325, 75, 36, 25);
        phonePrefix.setBounds(361, 75, 36, 25);
        phoneSuffix.setBounds(397, 75, 48, 25);
        ssnLabel.setBounds(325, 100, 200, 25);
        ssn1.setBounds(325, 125, 36, 25);
        ssn2.setBounds(361, 125, 36, 25);
        ssn3.setBounds(397, 125, 36, 25);
        genderLabel.setBounds(325, 150, 75, 25);
        genderText.setBounds(400, 150, 24, 25);
        addressLabel.setBounds(325,200,100,25);
        addButton.setBounds(325, 225, 100, 25);
        removeButton.setBounds(425, 225, 100, 25);
        submitButton.setBounds(25,300,100,25);

        //Layout
        namePanel.setLayout(new GridLayout(3, 2));

        //namePanel properties
        namePanel.setBackground(Color.lightGray);
        namePanel.add(lastLabel);
        namePanel.add(lastText);
        namePanel.add(firstLabel);
        namePanel.add(firstText);
        namePanel.add(middleLabel);
        namePanel.add(middleText);

    }
}
